const getDefaultState = () => {
  return {
    teamData: '',
    teamName: '',
    teamId: window.localStorage.getItem('team-data') ? window.localStorage.getItem('team-data'): '',
    isTeam:'',
  }
}
const state = getDefaultState()

const mutations = {
  SET_TEAMDATA: (state, teamData) => {
    state.teamData = teamData
  },
  SET_TEAMID: (state, teamId) => {
    window.localStorage.setItem('team-data', teamId)
    state.teamId = teamId
  },
  SET_TEAMNAME: (state, teamName) => {
    state.teamName = teamName
  },
  SET_ISTEAM: (state, isTeam) => {
    state.isTeam = isTeam
  }
}

export default {
  namespaced: true,
  state,
  mutations
}
